/**
*      author: Y_Yao
*      created: 2025-03-22 20:03:56
**/

#include<bits/stdc++.h>

#define int LL
using namespace std;
using LL = long long;
const LL LLINF = 9e18;
const int INF = 0x3f3f3f3f;
const int N = 7 + 7;
int a[N];
int cnt[N];


void solve()
{
    for(int i = 1;i <= 7;i++)
    {
        cin >> a[i];
        cnt[a[i]]++;
    }

    bool f1 = false;
    bool f2 = false;
    for(int i = 1;i <= 13;i++)
    {
        if(!f1 && cnt[i] >= 3)
        {
            f1 = true;
            cnt[i] = 0;
        }
        if(!f2 && cnt[i] >= 2)
        {
            f2 = true;
            cnt[i] = 0;
        }
    }
    if(f1 && f2)
    {
        cout << "Yes" << endl;
        return;
    }
    cout << "No" << endl;
}

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int t = 1;
    //cin >> t;
    while(t--)
    {
        solve();
    }
    return 0;
}